<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>管理员登录-内容管理系统</title>

    <link href="/Public/bootstrap/css/bootstrap.min.css" rel="stylesheet">
    <link rel="stylesheet" href="/Public/assets/css/common.css">
    
</head>
<body>

<nav class="navbar navbar-default navbar-fixed-top col-md-10">
    <div class="container-fluid nav_bg">
        <!-- Brand and toggle get grouped for better mobile display -->
        <div class="navbar-header">
            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse"
                    data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>

            <a class="navbar-brand" href="<?php echo U('File/home_page');?>">首页</a>
            <a class="navbar-brand" href="<?php echo U('Link/index');?>">友情链接</a>


        </div>


        <!-- Collect the nav links, forms, and other content for toggling -->
        <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
            <ul class="nav navbar-nav navbar-right">
                <li class="dropdown">
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true"
                       aria-expanded="false">尊敬的 <?php echo ($user["email"]); ?><span class="caret"></span></a>
                    <ul class="dropdown-menu">
                        <li><a href="<?php echo U('Article/index');?>">文章信息</a></li>
                        <li><a href="<?php echo U('Category/index');?>">栏目管理</a></li>
                        <li><a href="<?php echo U('System/information');?>">公司信息</a></li>
                        <li><a href="<?php echo U('System/password_change');?>">修改密码</a></li>
                     
                        <li><a href="<?php echo U('System/clear_cache');?>">清除缓存</a></li>
                        <li role="separator" class="divider"></li>
                        <li><a href="<?php echo U('User/logout');?>">安全退出</a></li>
                    </ul>
                </li>
            </ul>
        </div><!-- /.navbar-collapse -->
    </div><!-- /.container-fluid -->
</nav>

<div class="container-fluid">
    
    <div class="row">
        <div class="col-md-12">

            <div class="row">
                <div class="col-md-8">
                    <div class="page-header">
                        <h1></h1>
                    </div>
                </div>
            </div>

            <div class="row">
                <div class="col-md-10">
                    <div class="panel panel-default">
                        <div class="panel-heading">文章列表</div>

                        <a href="<?php echo U('Article/create');?>" target="_self" class="btn btn-info addcate">添加文章</a>
                        <button type="submit" class="btn btn-danger destroy_checked">删除</button>


                        <div class="panel-body">
                            <table class="table">


                                <tr>
                                    <td><input type="checkbox" id="checkall" name="" value=""></td>
                                    <td>全选</td>

                                </tr>


                                <tr>

                                    <td><a><span class="glyphicon glyphicon-resize-vertical"></span></a></td>
                                    <td>标题</td>
                                    <td>所属栏目</td>
                                    <td>发布日期</td>
                                    <td><a><span class="glyphicon glyphicon-wrench"></span></a></td>
                                </tr>

                                <form method="post" action="" id="form">
                                <?php if(is_array($list)): $i = 0; $__LIST__ = $list;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$a): $mod = ($i % 2 );++$i;?><tr>

                                    <td><input type="checkbox" class="del_check" name="delete_id[]" value="<?php echo ($a["id"]); ?>"></td>
                                    <td><a><font color="<?php echo ($a["title_color"]); ?>"><?php echo ($a["title"]); ?></a></td>
                                    <td><?php echo ($a["category"]["name"]); ?></td>
                                    <td><?php echo (date("Y-m-d",$a["time"])); ?></td>
                                    <td>
                                        <a href="<?php echo U('edit',array(id=>$a['id']));?>"><span class="glyphicon glyphicon-pencil"></span></a>
                                        <a href="<?php echo U('del',array(id=>$a['id']));?>"><span class="glyphicon glyphicon-remove"></span></a>
                                    </td>
                                </tr><?php endforeach; endif; else: echo "" ;endif; ?>
                                </form>





                            </table>
                            <div class="pagination"><?php echo ($page); ?></div>





                        </div>







                        </div>
                    </div>
                <div class="col-md-2">
                    <div class="list-group">
                        <a href="<?php echo U('create_article');?> " class="list-group-item list-group-item-info sort_category" >
                            <span class="glyphicon glyphicon-plus" aria-hidden="true"></span> 新增 (add)
                        </a>
                        <a href="javascript: void 0;" class="list-group-item list-group-item-info sort_category" id="">
                            <span class="glyphicon glyphicon-trash" aria-hidden="true"></span> 删除 (del)
                        </a>
                    </div>
                </div>
                </div>




            </div>
        </div>
    </div>

</div>

<script src="//cdn.bootcss.com/jquery/1.11.3/jquery.min.js"></script>
<script src="/Public/bootstrap/js/bootstrap.min.js"></script>


    <script>
        $(function () {
            $("#checkall").click(function () {
                $(".del_check").prop("checked",this.checked);
            });
            $(".destroy_checked").click(function () {
                var length = $(".del_check:checked").length;
                if (length==0){
                    alert("你必须选取一个")
                    return false;
                }
                $("#form").attr('action',"<?php echo U('destroy_checked');?>").submit();

            })

        })

    </script>


</body>
</html>